<template>
	<view class="pt70 pd">
		<view class="khjhnnderr row pl70 ">
			<view class="col fz30 cf">
				解锁控制面板
			</view>
			<switch :checked="isxzs"  @change="switchChange"/>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				isxzs: false
			}
		},
		components: {
			
		},
		methods: {
			switchChange(e){
				let value = e.target.value
				let that = this
				if (value) {
					uni.showToast({
						title:'滑动解锁已开启'
					})
					let locks = {type:3,vaule:''}
					uni.setStorageSync('locks',locks)
					uni.navigateBack({
						delta:1
					})
				}else{
					if(this.istype == 3){
						uni.removeStorageSync('locks');
					}
				}
				
				
				
				
			}
		},
		onShow(){
			let locks = uni.getStorageSync('locks')
			console.log(locks);
			this.istype = locks.type
			if(locks.type == 3){
				this.isxzs = true
			}
		},
		mounted() {
			
		}
	}
</script>
<style scoped>
	.khjhnnderr{
		height:140upx;
		line-height: 140upx;
		background:rgba(53,60,81,1);
		border-radius:12upx;
	}
</style>
